@import 'card.mixin'

.card
  width: 100%
  background-color: $white
  border-radius: 3px
  box-shadow: 0 1px 2px $grey-darker

  .card-header
    padding: 30px
    font-size: 1.1em
    font-weight: 400
    border-bottom: 1px solid $grey
    border-left: 0px solid transparent
    color: $black-lighter
    position: relative
    @include flex

    .card-title
      flex: 1
    .card-action
      list-style: none
      margin: 0
      padding: 0
      & > li
        & > a
          color: $grey
        & > .dropdown-menu
          right: 0
          left: auto
          border-radius: 2px

  .card-body
    padding: 30px
  
  &.card-mini
    .card-header
      padding: 20px 30px
    .card-body
      padding: 20px 30px

  &.card-tab
    .card-header
      padding: 0
      background-color: $grey-lightest
      border-bottom: 0
      overflow-x: scroll
      overflow-y: visible

    .card-header > ul, ul.nav-tabs
      list-style: none
      padding: 0
      margin-bottom: 0
      @include flex
      width: 100%
      font-weight: 400
      border-bottom: 1px solid $grey

      & > li
        display: block
        margin-bottom: -2px
        z-index: 10
        width: 140px
        min-width: 140px
        a
          padding: 20px 30px
          width: 100%
          text-align: center
          display: block
          text-decoration: none
          color: $grey-darkest
          white-space: nowrap
          text-overflow: ellipsis
          overflow: hidden
        &.active
          border-left: 1px solid $grey
          border-right: 1px solid $grey
          background-color: $white
          a
            color: $green
            border-bottom: none !important
        &:first-child
          &.active
            border-left: 0
    .tab-content
      padding: 0
      position: relative
      transition: all 0.3s ease
      .tab-pane
        @include absolute($height: auto)
        display: none
        padding: 30px
        transition: all 0.3s ease
        opacity: 0
        &.active
          transform: translate(0, 0)
          position: relative
          opacity: 1
          display: block

    // Angular UI Tabs
    & > .ng-isolate-scope
      & > .nav-tabs
        background-color: $grey-lightest
        & > li
          &.active
            border-bottom: 2px solid $white
            border-left: 1px solid $grey
            border-right: 1px solid $grey
            background-color: $white
            a
              color: $green
      .tab-content
        .tab-pane
          opacity: 0
          &.active
            opacity: 1

  &.card-tab.card-mini
    .card-header, ul.nav-tabs
      & > li
        a
          padding-top: 20px
          padding-bottom: 20px
  &.card-banner
    width: 100%
    position: relative
    overflow: hidden
    display: block
    border-radius: 2px
    transition: all 0.2s ease

    &:hover
      cursor: pointer
      text-decoration: none

    .card-header
      background-color: $white

    .card-body
      padding: 0px

      .icon
        position: absolute
        top: 50%
        transform: translate(0, -50%)
        font-size: 4em
        color: $black
        z-index: 0
        padding: 10px
        min-height: 100%
        min-width: 100px
        @include flex($align: center, $justify: center)

      .content
        @include flex($direction: column, $justify: flex-end, $align: flex-end)
        position: relative
        width: 100%
        padding: 2rem
        z-index: 100

        .value
          font-size: 4em
          line-height: 3rem
          font-weight: 200
          padding-top: 2rem
          color: $black
          .sign
            font-size: 0.4em
            font-weight: 200
            margin-right: 5px
            opacity: 0.75

        .title 
          font-size: 1em
          font-weight: 400
          color: $grey-darkest
          text-transform: uppercase
    
      &::after
        content: ''
        position: relative
        display: block
        clear: both

  &.card-chart
    .card-header
      border-bottom: 0

      .card-title
        .title
          background-color: $white
          padding: 6px 12px
          border-radius: 2px
          font-weight: 400
          width: auto
          display: inline
          text-transform: uppercase

  @include banner("green", $green, $white)
  @include banner("blue", $blue-sky, $white)
  @include banner("orange", $orange, $white)
  @include banner("yellow", $yellow, $white)

@include breakpoint($sm)
  .card
    .card-header
      padding: 15px
    .card-body
      padding: 15px
    &.card-mini
      .card-header
        padding: 15px
      .card-body
        padding: 15px
    &.card-tab
      .card-header
        padding: 0
      .card-body
        padding: 0
      .tab-content
        .tab-pane
          padding: 15px
    &.card-tab.card-mini
      .card-header, ul.nav-tabs
        & > li
          a
            padding-top: 15px
            padding-bottom: 15px
    &.card-banner
      .card-body
        .icon
          font-size: 3em
          min-width: 80px
        .content
          padding: 1rem
          .value
            font-size: 3em
            padding-top: 1rem
          .title 
            font-size: 0.9em